/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mac
 * Date: 2022-08-31
 * Time: 9:09
 */
public class LinkedListDemo {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        //myLinkedList.createList();
        /*myLinkedList.addFirst(12);
        myLinkedList.addFirst(23);
        myLinkedList.addFirst(34);
        myLinkedList.addFirst(45);
        myLinkedList.addFirst(56);*/

        myLinkedList.addLast(12);
        myLinkedList.addLast(23);
        myLinkedList.addLast(25);
        myLinkedList.addLast(34);
        myLinkedList.addLast(45);
        myLinkedList.addLast(56);
        myLinkedList.display();

        /*myLinkedList.addIndex(0,99);
        myLinkedList.addIndex(myLinkedList.size(), 99);
        myLinkedList.addIndex(2,99);*/

        /*myLinkedList.remove(56);

        myLinkedList.display();
        boolean flg = myLinkedList.contains(56);
        System.out.println(flg);
        System.out.println(myLinkedList.size());*/

       /* ListNode ret = myLinkedList.reverseList(myLinkedList.head);
        myLinkedList.display2(ret);*/
        ListNode ret = myLinkedList.middleNode(myLinkedList.head);
        System.out.println(ret.val);
    }
}
